#!/bin/bash
echo " *******************************************************"
echo " *                                                     *"
echo " *                  Plot an histogram                  *"
echo " *                                                     *"
echo " *          Using the Caltech pgplot libraries         *"
echo " *                                                     *"
echo " *   Copyright (c) 1983-1997 by the California         *"
echo " *             Institute of Technology.                *"
echo " *   Martin Aube 2000                                  *"
echo " *                                                     *"
echo " *******************************************************"
echo " "
folder=`pwd`
rm -f core
echo " Experiment directory "$folder
ls *.pgm 
ls *.cxy
ln -s ~/AODSEM/Bin/histogram histogram

echo " Executing histogram..."
./histogram
convert -rotate 90 pgplot.ps histogram.jpg
display histogram.jpg
mv pgplot.ps histogram.ps
echo " Deleting temporary files in " $folder

rm -f histogram

if [ -f core ] 
   then   echo "******** An error occured during execution of histo! ********"
   rm -f core
   echo "Hit <CTRL-c> or <CRTL-z> to kill that process"
   read bidon
else
  echo " Normal end of histo." 
fi 



